package com.itec.learn.java.design.factory;

/**
 * @author chenyiqun
 */
public class PizzaStore {

    public Pizza orderPizza(String type){
        Pizza pizza;
        if (type.equals("cheese")){
            pizza = new CheesePizza();
        } else if (type.equals("greek")){
            pizza = new GreekPizza();
        } else {
            pizza = new SimplePizza();
        }

        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();

        return pizza;
    }
}
